﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="coursesPanel.aspx.cs" Inherits="Presentation.Content.cursesPanel" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Gestion de Cursos - Academy Manager</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <a name="panel"></a>
    <h1>
        Gestion de cursos</h1>
    <form id="frmPanel" runat="server">
    <asp:MultiView ID="mvDdlMain" runat="server" ActiveViewIndex="0">
        <asp:View ID="vDDL" runat="server">
            <table>
                <tr>
                    <td>
                        Seleccionar funcionalidad:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlMain" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlMain_SelectedIndexChanged1">
                            <asp:ListItem Value="none">Elija una funcionalidad...</asp:ListItem>
                            <asp:ListItem Value="New">Agregar nuevo curso</asp:ListItem>
                            <asp:ListItem Value="Modify">Modificar curso</asp:ListItem>
                            <asp:ListItem Value="AddInscription">Alta/Baja de alumnos a curso</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <asp:MultiView ID="mvSearchCourses" runat="server" ActiveViewIndex="-1">
        <asp:View ID="vSearchCourse" runat="server">
            <table>
                <tr>
                    <td>
                        <asp:TextBox ID="txtSearchCourse" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="btnSearchCourse" runat="server" Text="Buscar Curso" CssClass="boton"
                            OnClick="btnSearchCourse_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView ID="gvCourses" runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="gvCourses_SelectedIndexChanged1">
                <Columns>
                    <asp:BoundField AccessibleHeaderText="Numero" DataField="Numero" HeaderText="Numero">
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField AccessibleHeaderText="Nombre" DataField="Nombre" HeaderText="Nombre">
                        <ItemStyle HorizontalAlign="Justify" />
                    </asp:BoundField>
                    <asp:BoundField AccessibleHeaderText="Descripcion" DataField="Descripcion" HeaderText="Descripcion">
                        <ItemStyle HorizontalAlign="Justify" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Seleccionar">
                        <ItemTemplate>
                            <asp:Button ID="btnSelect" runat="server" CausesValidation="false" CommandName="Select"
                                Text="Seleccionar" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Eliminar">
                        <ItemTemplate>
                            <asp:Button ID="btnDelete" runat="server" CausesValidation="false" CommandName="Delete"
                                Text="Delete" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </asp:View>
    </asp:MultiView>
    <asp:MultiView ID="mvMain" runat="server" ActiveViewIndex="-1">
        <asp:View ID="vNewModifyCourse" runat="server">
            <table>
                <tr>
                    <td>
                        Número de registro:
                    </td>
                    <td>
                        <asp:Label ID="lblNroId" runat="server"></asp:Label>&nbsp;&nbsp;<br />
                    </td>
                </tr>
                <tr>
                    <td>
                        Nombre del curso:
                    </td>
                    <td>
                        <asp:TextBox ID="txtCourseName" ValidationGroup="gPanel" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                    <td>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvName" runat="server" ErrorMessage="Debe ingresar un nombre."
                            ControlToValidate="txtCourseName" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Lugar:
                    </td>
                    <td>
                        <asp:TextBox ID="txtPlace" ValidationGroup="gPanel" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                    <td>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvPlace" runat="server" ErrorMessage="Debe ingresar un un lugar."
                            ControlToValidate="txtPlace" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Costo por clase:
                    </td>
                    <td>
                        <asp:TextBox ID="txtPrice" ValidationGroup="gPanel" runat="server" MaxLength="6"></asp:TextBox>
                    </td>
                    <td>
                        dólares
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvPrice" runat="server" ErrorMessage="    Debe ingresar un costo por clase."
                            ControlToValidate="txtPrice" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Profesor del curso:
                    </td>
                    <td>
                        <asp:Label ID="lblTeacher" runat="server"></asp:Label>&nbsp;&nbsp;<br />
                    </td>
                </tr>
                <tr>
                    <td>
                        Cantidad de clases previstas:
                    </td>
                    <td>
                        <asp:Label ID="lblClassCount" runat="server"></asp:Label>&nbsp;&nbsp;<br />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        Descripción:
                    </td>
                    <td>
                        <asp:TextBox ID="txtDesc" ValidationGroup="gPanel" TextMode="MultiLine" runat="server"
                            MaxLength="200"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="rfvDesc" runat="server" ErrorMessage="Debe ingresar una descripcion de la clase."
                            ControlToValidate="txtDesc" ValidationGroup="gPanel"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <asp:MultiView ID="mvSearchbox" runat="server" ActiveViewIndex="-1">
        <asp:View ID="View1" runat="server">
            <table>
                <asp:MultiView ID="mvActionStudent" runat="server" ActiveViewIndex="-1">
                    <asp:View ID="View2" runat="server">
                        <tr>
                            <td>
                                Acción:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlActionStudent" runat="server" AutoPostBack="True">
                                    <asp:ListItem Value="AddStudent">Inscribir a un curso</asp:ListItem>
                                    <asp:ListItem Value="DeleteStudent">Eliminar inscripcion a curso</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </asp:View>
                </asp:MultiView>
                <tr>
                    <td>
                        <asp:TextBox ID="txtSearchStuTeacher" runat="server" MaxLength="40"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="btnSearchStuTeacher" runat="server" Text="Buscar" CssClass="boton"
                            OnClick="btnSearchStuTeacher_Click" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <asp:MultiView ID="mvAddTeacherStudents" runat="server" ActiveViewIndex="-1">
        <asp:View ID="vAddStudents" runat="server">
            <table>
                <tr>
                    <td>
                        <h3>
                            Buscar alumnos para agregar</h3>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="gvStudents" runat="server" AutoGenerateColumns="False">
                            <Columns>
                                <asp:BoundField AccessibleHeaderText="Numero" DataField="Numero" HeaderText="Numero">
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField AccessibleHeaderText="Nombres" DataField="Nombres" HeaderText="Nombres">
                                    <ItemStyle HorizontalAlign="Justify" />
                                </asp:BoundField>
                                <asp:BoundField AccessibleHeaderText="Apellidos" DataField="Apellidos" HeaderText="Apellidos">
                                    <ItemStyle HorizontalAlign="Justify" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Agregar inscripcion">
                                    <ItemTemplate>
                                        <asp:Button ID="btnAdd" runat="server" CausesValidation="false" CommandName="Select"
                                            Text="Agregar/Quitar" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="vAddTeacher" runat="server">
            <table>
                <tr>
                    <td>
                        <h3>
                            Seleccionar Profesor</h3>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="gvTeachers" runat="server" AutoGenerateColumns="False">
                            <Columns>
                                <asp:BoundField AccessibleHeaderText="Numero" DataField="Numero" HeaderText="Numero">
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField AccessibleHeaderText="Nombres" DataField="Nombres" HeaderText="Nombres">
                                    <ItemStyle HorizontalAlign="Justify" />
                                </asp:BoundField>
                                <asp:BoundField AccessibleHeaderText="Apellidos" DataField="Apellidos" HeaderText="Apellidos">
                                    <ItemStyle HorizontalAlign="Justify" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Agregar a curso">
                                    <ItemTemplate>
                                        <asp:Button ID="btnAdd" runat="server" CausesValidation="false" CommandName="Select"
                                            Text="Agregar" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <table>
        <tr>
            <td>
                <asp:MultiView ID="mvButtons" runat="server" ActiveViewIndex="-1">
                    <asp:View ID="vBtnModify" runat="server">
                        <asp:Button ID="btnModificar" runat="server" Text="Modificar Datos" CssClass="boton"
                            ValidationGroup="gPanel" />
                    </asp:View>
                    <asp:View ID="vBtnNew" runat="server">
                        <asp:Button ID="btnNew" runat="server" Text="Agregar nuevo" CssClass="boton" ValidationGroup="gPanel" />
                    </asp:View>
                </asp:MultiView>
            </td>
        </tr>
    </table>
    <asp:Label ID="lblInfo" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
    </form>
    <script type="text/javascript">
        window.onload = function () {
            var ele = document.getElementById("content_lblInfo");
            if (ele.innerHtml != "") {
                window.setTimeout(function () { ele.innerHTML = ""; }, 5000);
            }
        };
    </script>
</asp:Content>
